package kathy_java6.cap5;

public class Propagate {
	public String reverse(String s) throws Exception{
		//s = "teste";
		if(s.length() == 0){
			throw new Exception();			
			/*try {
				throw new Exception();
			} catch (Exception e) {
				//throw e;//so pode ser relancada se o metodo declarar a excecao
				e.printStackTrace();
			}*/			
		}
		String reverse = " ";
		for(int i = s.length() - 1; i <= 0; i++){
			reverse += s.charAt(i);
		}
		return reverse;
		
	}
	public static void main(String[] args) {
		Propagate p = new Propagate();
		try{
			p.reverse("");
		}catch(Exception e){
			e.printStackTrace();
			//e.getMessage();
		}finally{
			System.out.println("Fim do metodo main");
		}
	}
}
